{extend name="public/layout" /}
{block name="head"}
<style>
  .config {
    display: none;
  }
</style>
{/block}
{block name="body"}

<body>
  <div class="container-fluid p-t-15">
    <div class="card">
      <ul class="nav nav-tabs page-tabs">
        {volist name="group_list" id="vo"}
        <li {eq name="$vo['dict_code']"><a href="/system/config/index.html?group={$vo.dict_code}">{$vo.dict_value}</a>
        </li>
        {/volist}
        <li class="active"><a href="/system/config/upload.html">上传配置</a></li>
        <li><a href="/system/config/sms.html">短信配置</a></li>
      </ul>
      <div class="tab-content">
        <div class="tab-pane active">
          <form id="form" class="form-horizontal">
            <div class="form-group">
              <label class="col-sm-2 control-label">默认上传驱动</label>
              <div class="col-sm-4">
                <select id="default" name="default" class="form-control" datatype="*">
                  <option value="">请选择默认上传驱动</option>
                  <option value="public" {eq name="$config.default" value="public" }selected{/eq}>本地存储</option>
                  <option value="qiniu" {eq name="$config.default" value="qiniu" }selected{/eq}>七牛云存储</option>
                  <option value="oss" {eq name="$config.default" value="oss" }selected{/eq}>阿里云存储</option>
                  <option value="cos" {eq name="$config.default" value="cos" }selected{/eq}>腾讯云存储</option>
                </select>
              </div>
            </div>
            <div class="config public">
              <div class="form-group">
                <label class="col-sm-2 control-label">前缀域名</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[public][domain]"
                    value="{$config.disks.public.domain}" />
                </div>
              </div>
            </div>
            <div class="config qiniu">
              <div class="form-group">
                <label class="col-sm-2 control-label">accessKey</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[qiniu][accessKey]"
                    value="{$config.disks.qiniu.accessKey}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">secretKey</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[qiniu][secretKey]"
                    value="{$config.disks.qiniu.secretKey}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">bucket</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[qiniu][bucket]"
                    value="{$config.disks.qiniu.bucket}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">前缀域名</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[qiniu][domain]"
                    value="{$config.disks.qiniu.domain}" />
                </div>
              </div>
            </div>
            <div class="config oss">
              <div class="form-group">
                <label class="col-sm-2 control-label">accessId</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[oss][accessId]"
                    value="{$config.disks.oss.accessId}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">accessSecret</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[oss][accessSecret]"
                    value="{$config.disks.oss.accessSecret}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">bucket</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[oss][bucket]"
                    value="{$config.disks.oss.bucket}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">endpoint</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[oss][endpoint]"
                    value="{$config.disks.oss.endpoint}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">前缀域名</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[oss][domain]"
                    value="{$config.disks.oss.domain}" />
                </div>
              </div>
            </div>
            <div class="config cos">
              <div class="form-group">
                <label class="col-sm-2 control-label">region</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][region]"
                    value="{$config.disks.cos.region}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">appId</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][credentials][appId]"
                    value="{$config.disks.cos.credentials.appId}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">secretId</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][credentials][secretId]"
                    value="{$config.disks.cos.credentials.secretId}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">secretKey</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][credentials][secretKey]"
                    value="{$config.disks.cos.credentials.secretKey}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">bucket</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][bucket]"
                    value="{$config.disks.cos.bucket}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">CDN域名</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][domain]"
                    value="{$config.disks.cos.domain}" />
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">scheme</label>
                <div class="col-sm-4">
                  <input type="text" class="form-control" name="disks[cos][scheme]"
                    value="{$config.disks.cos.scheme}" />
                </div>
              </div>

            </div>
            <div class="form-group">
              <div class="col-sm-10 col-sm-offset-2">
                <div class="pull-left">
                  <button type="button" class="btn btn-primary btn-sub">保存</button>
                  <button type="button" class="btn btn-default btn-reset">重置</button>
                </div>
                <div class="pull-left m-l-15">
                  <p class="error-msg"></p>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
  <script>
    var defaultUpload = $('#default');
    defaultUpload.change(function () {
      var value = $(this).val();
      $('.config').hide();
      if (!valid.isEmpty(value)) $('.' + value).show();
    });
    defaultUpload.trigger('change');
    formHelper.subForm(function () {
      helper.refresh();
    });
  </script>
</body>
{/block}